<template>
  <el-container style="height: 100%;" class="dealBaseHome">
    <el-header v-loading="loading" class="app-header">
      <div class="titlebar">
        <div class="titlebar-title">
          <div class="title">
            <div class="tit">
              <el-button class="tipText" type="text">
                <p style="width:100%;"> {{ lpName }}</p>
              </el-button>
            </div>
            <div class="tab-change" style="flex: 1;justify-content: flex-end;">
              <Internationalization v-show="lpName === '国际化'" />
            </div>
          </div>
        </div>
      </div>
    </el-header>

    <div class="page-component__scroll">
      <fullView
        ref="fullView"
        :bus-id="busId"
        bus-type="fund"
        :child-left-menu="menuList"
        :bus-name="lpName"
        :default-active="activeIndex"
      />
    </div>
  </el-container>
</template>

<script>
  import { getLpBase } from '@/api/fund/lpBase/lpBase'
  import { childMenuList } from '@/api/system/menu'
  import fullView from '@/components/fullView'
  export default {
    components: {
      fullView
    },
    data() {
      return {
        loading: false,
        busId: this.$route.query.lpId,
        // 弹出层标题
        title: '修改logo',
        // name
        lpName: this.$route.query.name,
        // 公司ID
        lpId: this.$route.query.lpId,
        menuList: [],
        activeIndex: ''
      }
    },
    created() {
      this.getLpBase()
      this.listLoad()
    },
    mounted() {
    },
    methods: {
      load() {
        if (this.$refs.menuPath?.init !== undefined) {
          const data = { id: this.busId, busType: 'manager' }
          this.$refs.menuPath.init(data)
          this.$refs.menuPath.openLocation = 'Home'
        }
      },
      // 初始化数据
      getLpBase() {
        if (this.lpId != null && this.lpId !== undefined) {
          getLpBase(this.lpId).then(response => {
            this.lpName = document.title = response.data.name
          })
        }
      },
      listLoad() {
        // 菜单列表
        childMenuList('lp_base').then(response => {
          this.menuList = response.rows
          this.activeIndex = this.menuList[0].id
        })
      }
    }
  }
</script>

<style scoped>
  .voteMain {
    margin-left: 200px;
  }
</style>
